<template>
  <div class="picking zy-content pb50">
    <back-level @click="close" />
    <Tabs :value="tabName" @on-click="tabChange" name="moldDetail" class="tabs-layout">
      <!-- <TabPane class="mt16" :label="$t('台账信息')" :name="$t('台账信息')">
        <template v-if="tabName === $t('台账信息')">
          <Card :title="$t('preliminary.BasicInformation')" class="detail-content-layout">
            <div class="basic-info">
              <div class="basic-info-body">
                <Row style="border-top: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('equipCheck.SerialNo')
                    }}</Col>
                    <Col class="basic-info-body-item" span="24">{{ detailObj.deviceMId }}</Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{ $t('maintenance.EquipmentNo')
                    }}</span></Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow || $route.query.status != 'add'">{{ detailObj.deviceNo }}</div>
                    <Input v-else v-model="detailObj.deviceNo" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row >
                    <Col class="basic-info-body-label" span="24">{{ $t('设备等级') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <span>{{ detailObj.deviceGrade }}</span>
                    </Col>
                  </Row>
                  </Col>
                </Row>

                <Row style="border-top: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">
                    <span class="required">设备评分</span>
                    </Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.score }}</div>
                    <InputNumber style="width:100%" :min="0" :max="100" :step="0.1" v-else v-model="detailObj.score"
                      class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">设备品牌</span></Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.brand }}</div>
                    <Input maxlength="50" v-else v-model="detailObj.brand" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">

                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{ $t('equipCheck.Model')
                    }}</span></Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.deviceSpec }}</div>
                    <Input v-else maxlength="50" v-model="detailObj.deviceSpec" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{ $t('maintenance.EquipmentName')
                    }}</span></Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.deviceName }}</div>
                    <Input v-else v-model="detailObj.deviceName" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('设备英文名称') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.deviceEnglish }}</div>
                    <Input v-else v-model="detailObj.deviceEnglish" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{ $t('设备类别') }}</span></Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.deviceCategory }}</div>
                    <Select v-else v-model="detailObj.deviceCategory" filterable clearable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) in deviceCategoryList" :key="index" :value="item.value"
                        :label="item.value" />
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">

                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{
                      $t('preliminary.EquipmentSource') }}</span></Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">{{ detailObj.deviceSource }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Select v-model="detailObj.deviceSource" filterable clearable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) in deviceSource" :key="index" :value="item.value"
                        :label="item.value" />
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">功能位置</span></Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.installPositionName }}
                    </Col>
                    <Col v-else class="basic-info-body-item" span="24">
                    <Cascader style="margin-top: 8px;" :data="orgList" v-model="detailObj.installPosition">
                    </Cascader>
                    </Col>

                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('equipmentscrapped.CostCenter') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.costCenter }}</div>
                    <Input v-else v-model="detailObj.costCenter" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.Voltage') }}（V）</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.voltage }}</div>
                    <Input v-else v-model="detailObj.voltage" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.EquipmentPower') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.devicePower }}</div>
                    <Input v-else v-model="detailObj.devicePower" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.EquipmentWeight') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.deviceWeight }}</div>
                    <Input v-else v-model="detailObj.deviceWeight" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.ManufacturingNumber') }}
                    </Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.factoryNo }}</div>
                    <Input v-else v-model="detailObj.factoryNo" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.Equipmentuse') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.deviceUseto }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.deviceUseto" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.Department') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.useDept }}</div>
                    <Input v-else v-model="detailObj.useDept" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('排序') }}</Col>
                    <Col class="basic-info-body-item" span="24">
                    <div class="over-wrapper" v-if="!isShow">{{ detailObj.sort }}</div>
                    <Input type="number" v-else v-model.number="detailObj.sort" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
              </div>
            </div>
          </Card>
          <Card :title="$t('preliminary.AssetInformation')" class="detail-content-layout mt16">
            <div class="basic-info">
              <div class="basic-info-body">
                <Row style="border-top: 1px solid #eeeeee;border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.Vendor') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.supplier }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.supplier" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.Manufacturer') }}</Col>

                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.manufacturer }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.manufacturer" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">{{ $t('equipmentscrapped.AssetNo')
                    }}</span></Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.assetCode }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.assetCode" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('common.AssetClassfication') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.assetName }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Select v-model="detailObj.assetType" filterable clearable>
                      <Option v-for="item in assetsList" :value="item.value" :key="item.value" :label="item.value">
                      </Option>
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('equipCheck.Status') }}</Col>
                    <template v-if="!isShow">
                      <Col class="basic-info-body-item" span="24" style="display: flex;
                        justify-content: space-between;align-items: center;">
                      <span>{{ detailObj.deviceState }}</span>
                      </Col>
                    </template>
                    <template v-else>
                      <Col class="basic-info-body-item" span="24">
                      <Select v-model="detailObj.deviceState" :placeholder="`${$t('common.selectInfo')}`">
                        <Option v-for="(item) in resultList" :value="item.name" :key="item.name"
                          :label="item.name">
                        </Option>
                      </Select>
                      </Col>
                    </template>

                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.OriginalValue') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ numFormat(detailObj.deviceOriginalPrice) }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.deviceOriginalPrice" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.DepreciationLife') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.depreciation }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.depreciation" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('equipmentscrapped.ResidualValue') }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ numFormat(detailObj.deviceResiduePrice) }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.deviceResiduePrice" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.ManufacturingDate') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.manufacturDate }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Date-picker v-model="detailObj.manufacturDate" type="date" style="width: 100%;"
                      :options="produceOption" @on-change="produceDateChang" :clearable="false"
                      :placeholder="$t('common.selectInfo')" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row>
                  <Col span="8" style="border-left: 1px solid #eee; border-bottom: 1px solid #eeeeee">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('preliminary.FinalAcceptanceTime') }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.acceptDate }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Date-picker v-model="detailObj.acceptDate" type="date" style="width: 100%;"
                      :options="finalAcceptOption" @on-change="finalAcceptDateChang" :clearable="false"
                      :placeholder="$t('common.selectInfo')" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee; border-bottom: 1px solid #eeeeee">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.FixedAssetsTransferDate') }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.toRegularDate }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Date-picker v-model="detailObj.toRegularDate" style="width: 100%;" type="date" :clearable="false"
                      @on-change="(val) => { detailObj.toRegularDate = val }"
                      :placeholder="$t('common.selectInfo')" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
              </div>
            </div>
          </Card>
          <Card :title="$t('preliminary.ProductInformation')" class="detail-content-layout mt16">
            <div class="basic-info">
              <div class="basic-info-body">
                <Row style="border-top: 1px solid #eee;border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required"></span>{{ $t('common.Entity') }}
                    </Col>
                    <Col class="basic-info-body-item" span="24">

                    <Select v-if="$route.query.status === 'add'" v-model="detailObj.belongCompanyId" filterable clearable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) of tagList" :value="item.id" :key="index" :label="item.name">
                      </Option>
                    </Select>
                    <span v-else>{{ detailObj.belongCompanyName }}</span>
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.ManufacturingProcess') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.manufacturingProcess }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.manufacturingProcess" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24">{{ $t('ledger.PBoxBinding') }}</Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.isBindBox }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.isBindBox" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-top: 1px solid #eee;border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required"></span>合格品入库仓库
                    </Col>
                    <Col class="basic-info-body-item" span="24">
                    <Select :disabled="!isShow" v-model="detailObj.qualifiedWarehouseId" filterable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) of wareHouseList" :value="item.id" :key="index" :label="item.backupName">
                      </Option>
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">不良品入库仓库</span></Col>
                    <Col class="basic-info-body-item" span="24">
                      <Select :disabled="!isShow" v-model="detailObj.defectiveWarehouseId" filterable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) of wareHouseList" :value="item.id" :key="index" :label="item.backupName">
                      </Option>
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span class="required">材料领用仓库</span></Col>
                    <Col class="basic-info-body-item" span="24">
                      <Select :disabled="!isShow" v-model="detailObj.useWarehouseId" filterable
                      :placeholder="`${$t('common.selectInfo')}`">
                      <Option v-for="(item, index) of wareHouseList" :value="item.id" :key="index" :label="item.backupName">
                      </Option>
                    </Select>
                    </Col>
                  </Row>
                  </Col>
                </Row>
                <Row style="border-top: 1px solid #eee;border-bottom: 1px solid #eeeeee">
                  <Col span="8" style="border-left: 1px solid #eee;">
                  <Row>
                    <Col class="basic-info-body-label" span="24"><span>打印机名称</span>
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-if="!isShow">
                    {{ detailObj.printerName }}
                    </Col>
                    <Col class="basic-info-body-item" span="24" v-else>
                    <Input v-model="detailObj.printerName" class="Input-wrapper" />
                    </Col>
                  </Row>
                  </Col>
                </Row>
              </div>
            </div>
          </Card>
          <Card :title="$t('备注')" v-if="!isShow" class="detail-content-layout mt16">
            <div class="basic-info">
              <div class="basic-info-body tableContent">
                <template v-if="scoreId">
                  <Table :columns="descColumns" width="100%" :data="descData"></Table>
                </template>
              </div>
            </div>
          </Card>
        </template>
      </TabPane> -->
      <TabPane class="mt16" :label="$t('履历')" :name="$t('履历')" tab="moldDetail" v-if="!isHide">
        <template v-if="tabName === $t('履历')">
          <archivesComponent :dateParams="dateParams" />
        </template>
      </TabPane>
      <!-- <TabPane class="mt16" :label="$t('维修知识库')" :name="$t('维修知识库')" v-if="!isHide">
        <template v-if="tabName === $t('维修知识库')">
          <maintainKnowLedge sourceType="tab" :params="maintainKnowLedgeParams" />
        </template>
      </TabPane>
      <TabPane class="mt16" :label="$t('文档管理')" :name="$t('文档管理')" v-if="!isHide">
        <template v-if="tabName === $t('文档管理')">
          <knowLedge v-if="tabName === $t('文档管理')" :showClass="showStatus" />
        </template>
      </TabPane> -->
    </Tabs>

    <bottomHandleWrap v-show="isShow && tabName === $t('台账信息')">
      <Button @click="close" class="ivu-btn-lg mr16" :loading="laoding">{{ $t('common.Cancle') }}</Button>
      <Button type="primary" class="ivu-btn-lg" @click="handleSave" :loading="laoding">{{ $t('maintenance.Confirmed')
      }}</Button>
           <div slot="left" style="padding-top: 6px;" v-if="!isHide" />
           <div slot="left" style="padding-top: 6px;">
        <Button type="primary" @click="toLink('accept')">{{ $t('preliminary.acceptancerecord') }}</Button>
        <Button type="primary" @click="toLink('debug')">{{ $t('preliminary.Testingrecord') }}</Button>
        <Button type="primary" @click="toLink('peform')">{{ $t('preliminary.Performancerecord') }}</Button>
        <Button type="primary" @click="toLink('maintain')">{{ $t('preliminary.maintenancerecord') }}
        </Button>
        <Button type="primary" @click="toLink('repair')">{{ $t('preliminary.preserverecord') }}</Button>
        <Button type="primary" @click="toLink('change')">{{ $t('preliminary.Moverecord') }}</Button>
      </div>
    </bottomHandleWrap>

    <!-- <viewScoreInfo ref="viewScoreInfo" /> -->

    <Modal :mask-closable="false" title="设备状态变更记录" class="modal-content-layout" v-model="recordStatus" :width="1200">
      <Row :gutter="16">
        <Col :span="24">
        <Table ellipsis :columns="recordColumns" :data="recordData" />
        </Col>
      </Row>
      <div slot="footer">
        <Button type="default" @click="recordStatus = false">{{ $t('common.Cancle') }}</Button>
        <!--        <Button type="primary">{{ $t('maintenance.Confirmed') }}</Button>-->
      </div>
    </Modal>
  </div>
</template>

<script>
// import knowLedge from '@/views/knowledgeBase'
// import commentscore from "../../../../components/commentscore";
// import bomComponent from "./bomComponent";
import archivesComponent from "./archivesComponent";
// import modelComponent from "./modelComponent";
const isTong = process.env.NODE_ENV === 'tong';
let ksiot = '';
if (isTong) {
  ksiot = ''
}

// import maintainKnowLedge from '@/views/docManagement/maintainKnowLedge/index.vue'
// import viewScoreInfo from "@/views/devBasic/equipmentsLedgerManagement/modules/viewScoreInfo";
export default {
  name: "moldDetail",
  components: {
    // commentscore, bomComponent, modelComponent,archivesComponent, maintainKnowLedge, knowLedge,
    // viewScoreInfo,
    // maintainKnowLedge,
    archivesComponent
  },
  data() {
    return {
      recordstatusArr: [
        { key: '1', name: "再用" },
        { key: '2', name: "闲置" },
        { key: '3', name: "报废" },
      ],
      wareHouseList:[],
      recordColumns: [
        {
          title: '修改前状态',
          key: 'deviceStatusOld',
          align: "center",
          render: (h, params) => {
            return h('div', [
              h('span', {}, this.recordstatusArr.find(val => val.key === params.row.deviceStatusOld).name || '')
            ])
          }
        },
        {
          title: '修改后状态',
          key: 'deviceStatusNew',
          align: "center",
          render: (h, params) => {
            return h('div', [
              h('span', {}, this.recordstatusArr.find(val => val.key === params.row.deviceStatusNew).name || '')
            ])
          }
        },
        {
          title: '修改人',
          align: "center",
          key: 'createByStr'
        },
        {
          title: '修改时间',
          align: "center",
          key: 'createTime'
        }
      ],
      recordData: [],

      showStatus: true,
      dateParams: {},
      tabName: '',
      produceOption: {},
      finalAcceptOption: {},
      detailObj: {
        installPosition: [],
        score:null,
      },
      titleText: "",
      recordStatus: false,
      isShow: false,
      deviceStatusName: '',
      laoding: false,
      assetsList: [],
      scoreId: '',
      resultList: [{ id: 1, name: this.$t('在用') }, { id: 2, name: this.$t('闲置') }, { id: 3, name: this.$t('报废') }, { id: 4, name: this.$t('封存') }],
      orgList: [],//功能位置
      coneData: [],
      deviceCategoryList: [],
      maintainKnowLedgeParams: {},
      descColumns: [
        {
          title: this.$t('设备等级划分'),
          key: 'namevalue'
        },
        {
          title: this.$t('重要度'),
          key: 'importvalue'
        },
        {
          title: this.$t('D分值'),
          key: 'dvalue'
        }
      ],
      descData: [
        {
          namevalue: 'A',
          importvalue: this.$t('关键设备'),
          dvalue: '> 80'
        },
        {
          namevalue: 'B',
          importvalue: this.$t('次要设备'),
          dvalue: '60 - 80'
        },
        {
          namevalue: 'C',
          importvalue: this.$t('一般设备'),
          dvalue: '< 60'
        },
      ],
      devicePersonalList: [],
      usePersonalList: [],
      otPersonalList: [],
      tagList: [],
      isHide: false,
      deviceSource: [],
    }
  },
  created() {
    // if (this.$route.query.status == 'detail') {
    //   this.isShow = false
    //   this.titleText = `${this.$t('maintenance.Checkequipment')}`
    //   this.getLedgerDetailList()
    // } else if (this.$route.query.status == 'add') {
    //   this.isShow = true
    //   this.isHide = true
    // } else if (this.$route.query.status == 'edit') {
    //   this.isShow = true
    //   this.getLedgerDetailList()
    //   this.isHide = true
    // }else {
    //   this.isShow = true
    //   this.titleText = `${this.$t('maintenance.Editequipment')}`
    //   this.getLedgerDetailList()
    // }
    this.$nextTick(()=>{
      this.tabName='履历'
    })
  },
  mounted() {
    this.scoreId = this.$route.query.id
  },
  methods: {
    recordCheck() {
      this.recordData = []
      this.axios({
        method: 'get',
        url: '/dms/dmsDeviceTz/statusLog',
        params: {
          deviceId: this.$route.query.id
          // deviceId:1661
        }
      }).then(res => {
        if (res.code === 200) {
          if (res.data && res.data.length) {
            this.recordData = res.data
            this.recordStatus = true
          } else {
            this.$Message.warning(({ content: '无设备状态变更记录', duration: 6, closable: true }));
          }
        } else {
          this.$Message.warning(({ content: res.msg, duration: 6, closable: true }));
        }
      })
    },
    viewScoreInfoMethod() {
      this.$refs.viewScoreInfo.show()
    },
    devicePersonalSelect(val) {
      this.detailObj.equipmentManager = val.tag
    },
    usePersonalSelect(val) {
      this.detailObj.productionManager = val.tag
    },
    otPersonalSelect(val) {
      this.detailObj.otherManager = val.tag
    },

    tabChange(val) {
      this.tabName = val
    },
    produceDateChang(val) {
      this.finalAcceptOption = {
        disabledDate(date) {
          return date && date.getTime() < new Date(val).getTime()
        }
      }
    },
    finalAcceptDateChang(val) {
      this.produceOption = {
        disabledDate(date) {
          return date && date.getTime() > new Date(val).getTime()
        }
      }
    },
    handleCasChange(val, selectedData) {
      // console.log(val)
      // this.searchParams.orgId = val[val.length-1]
      // this.searchParams.orgName = selectedData[selectedData.length-1].label
    },
    filterData(arr, id) {
      let temp = [];
      let callback = function (nowArr, id) {
        for (let item of nowArr) {
          if (item.id === id) {
            temp.unshift(item.id);
            callback(arr, item.parentId)
            break;
          } else {
            if (item.children && item.children.length) {
              callback(item.children, id);
            }
          }
        }
      };
      callback(arr, id)
      return temp
    },
    //文件预览
    handlePreview(item) {
      if (item) {
        window.open(this.util.filePathToUrl(item.filePath));
      }
    },
    close() {
      this.$router.go(-1)
    },

    getLedgerDetailList() {
      this.axios({
        method: 'get',
        url: '/dms/device/selectById',
        params: {
          id: this.$route.query.id,
        }
      }).then(async res => {
        if (res.code === 200) {
          this.$nextTick(() => {
            this.detailObj = res.data
            this.detailObj.assetType = this.detailObj.assetType - 0;
            if (res.data.orgId) {
              const arr = this.filterData(this.coneData, res.data.orgId)
              this.detailObj.orgId = [...arr]
            }

            this.maintainKnowLedgeParams = {
              deviceCategory: this.detailObj.deviceCategory,
              deviceSpec: this.detailObj.deviceSpec,
              deviceNo: this.detailObj.deviceNo,
              deviceMId: this.detailObj.deviceMId,
              deviceName: this.detailObj.deviceName,
              deviceId: this.detailObj.deviceId,
              id: this.detailObj.id
            }
            this.dateParams = {
              acceptDate: this.detailObj.acceptDate || '',
              manufacturDate: this.detailObj.manufacturDate || '',
              installDate: this.detailObj.installDate || '',
              scrapData: '',
              toRegularDate: this.detailObj.toRegularDate || ''
            }
          })
        } else {
          this.$Message.warning(({ content: res.msg, duration: 6, closable: true }));
        }
      })
    },
    toLink(mainType) {
      let url = window.location.href.match(/^(?:[^\/]|\/\/)*/)
      let record = {
        deviceMId: this.detailObj.deviceMId,
        id: this.detailObj.id
      }
      switch (mainType) {
        case 'accept': {
          this.$router.push({
            path: '/devBasic/earlierStage/detailAcceptanceCheckModal',
            query: {
              id: record.id,
              arrivalStatus: record.arrivalStatus
            }
          })
          break;
        }
        case 'debug': {
          this.$router.push({
            path: '/devBasic/earlierStage/pdebugging/detailPdebuggingModal',
            query: {
              deviceMId: record.deviceMId,
              installStatus: record.installStatus
            }
          })
          break;
        }
        case 'peform': {
          this.$router.push({
            path: '/devBasic/earlierStage/checkAndAccept/detailCheckModal',
            query: {
              deviceMId: record.deviceMId,
              finalAcceptResult: record.finalAcceptResult
            }
          })
          break;
        }
        case 'change': {
          this.$router.push({
            name: 'equipmentsChangesList',
            query: {
              deviceMId: this.detailObj.deviceMId,
            }
          })
          break;
        }
        case 'check': {
          window.location.href = `${url[0]}${ksiot}/devScene/spotCheck/checkTask?deviceMId=${this.detailObj.deviceMId}`
          break;
        }
        case 'maintain': {
          window.location.href = `${url[0]}${ksiot}/devScene/maintain/management?deviceMId=${this.detailObj.deviceMId}`
          break;
        }
        case 'repair': {
          window.location.href = `${url[0]}${ksiot}/devScene/repair/statement?deviceMId=${this.detailObj.deviceMId}`
          break;
        }
        case 'accuracy': {
          window.location.href = `${url[0]}${ksiot}/devScene/accuracy/accuracyTask?deviceMId=${this.detailObj.deviceMId}`
          break;
        }
      }
    },
    numFormat(cellValue) {
      if (!cellValue) {
        return 0;
      }
      if (cellValue < 0) {
        return 0;
      }
      cellValue += '';
      if (!cellValue.includes('.')) cellValue += '.';
      return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
        return $1 + ',';
      }).replace(/\.$/, '');
    }
  }
}
</script>

<style scoped lang="scss">
.h-arrow-wrap {
  .iconfont {
    font-size: 18px;
    cursor: pointer;
  }
}

.basic-info {
  ::v-deep .ivu-date-picker {
    display: inline-block !important;
  }

  ::v-deep .ivu-row {
    display: flex;
    align-items: center;
  }

  .basic-info-title {
    span {
      display: inline-block;
      width: 7px;
      height: 24px;
      background: #187bdb;
    }

    h2 {
      display: inline-block;
      font-size: 16px;
      padding-left: 10px;
      position: relative;

      &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 7px;
        height: 24px;
        background: #187bdb;
      }
    }
  }

  .basic-info-body {
    //margin: 10px;
    color: #333;
    font-size: 13px;
    font-family: 'Arial Normal', 'Arial', sans-serif;
    font-weight: 400;

    .basic-info-body-label {
      display: inline-block;
      //width: 40%;
      min-height: 48px;
      line-height: 48px;
      background: #f5f6f7;
      text-align: left;
      padding: 0 10px;
      /*border-left: 1px solid #B6B7B7;*/
      /*border-top: 1px solid #B6B7B7;*/
      /*border-bottom: 1px solid #B6B7B7;*/
    }

    .basic-info-body-item {
      display: inline-block;
      //width: 60%;
      min-height: 48px;
      line-height: 48px;
      text-align: left;
      padding: 0 10px;
      // border-left: 1px solid #eee;
      // border-right: 1px solid #eee;
      /*border-right: 1px solid #B6B7B7;*/
      /*border-top: 1px solid #B6B7B7;*/
      /*border-bottom: 1px solid #B6B7B7;*/
    }
  }
}

.over-wrapper {
  // max-width: 200px;
  /*height: 23px;*/
  // overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>
